package com.dmap.analysispoint.service.impl;

import com.dmap.analysispoint.bo.DateAndNumBo;
import com.dmap.analysispoint.constants.BurialPointConstant;
import com.dmap.analysispoint.controller.background.param.CountParam;
import com.dmap.analysispoint.dao.BurialPointAppVersionMapper;
import com.dmap.analysispoint.po.BurialPointAppVersionExample;
import com.dmap.analysispoint.service.*;
import com.dmap.analysispoint.utils.ObjectTransitionArrayListUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * \* @author:zhouhao
 * \* Date:16/05/2018
 * \* Description:
 * \*
 */

@Service
public class HistoryTrendAnalysisServiceImpl implements HistoryTrendAnalysisService {

    @Resource
    private PhoneInfoAnalysisService phoneInfoAnalysisService;
    @Resource
    private UserInfoAnalysisService userInfoAnalysisService;
    @Resource
    private EquipmentInfoAnalysisService equipmentInfoAnalysisService;
    @Resource
    private BurialPointAppVersionMapper burialPointAppVersionMapper;
    @Resource
    private ParamDoService paramDoService;

    /**
     *
     * @param param String companyId;       公司编号
     *              String place;           渠道
     *              String projectId;       项目编号
     *
     * @return selectAppVersionList         所需要的app版本信息
     */
    @Override
    public List<String> selectAppVersionList(CountParam param) {
        BurialPointAppVersionExample example = new BurialPointAppVersionExample();
        BurialPointAppVersionExample.Criteria criteria = example.createCriteria();
        if (param.getCompanyId() != null){
            criteria.andCompanyIdEqualTo(param.getCompanyId());
        }
        if (param.getProjectId() != null){
            criteria.andProjectIdEqualTo(param.getProjectId());
        }
        if (param.getPlaceId() != null){
            criteria.andPlaceIdEqualTo(param.getPlaceId());
        }
        return burialPointAppVersionMapper.selectAppVersion(example);
    }

    /**
     *
     * @param param String companyId;       公司编号
     *              String place;           渠道
     *              String projectId;       项目编号
     *              String firmwareId;      设备固件编号
     *              String firmwareVersion; 设备固件版本号
     *              String appVersion;      app版本号
     *              Long startTime;         查询的开始时间
     *              Long endTime;           查询的结束时间
     *
     * @return keyIndicatorList                    历史趋势中关键指标的所有信息和数据
     *         其中里面分别为： 1.countList           过去一周/过去一周的前一周的活跃用户数、使用时长，过去一月/过去一月的之前一月的活跃用户数
     *                       2.addList             截止到目前为止累积手机数、帐号数、设备数
     */
    @Override
    public List<List> keyIndicatorList(CountParam param) {
        if (param == null) {
            return Collections.emptyList();
        }
        CountParam countParam = paramDoService.getParam(param);
        //过去一周的活跃用户数、使用时长
        int oneWeekBeforeActivePhoneNum = phoneInfoAnalysisService.countActivePhoneNumByDay(countParam);
        int oneWeekBeforeUseTime = userInfoAnalysisService.countUseTimeByDay(countParam);

        //过去一周的前一周的活跃用户数、使用时长
        countParam.setStartTime(countParam.getStartTime() - BurialPointConstant.ONE_DAY_TIME_MILLISECONDS * 7);
        countParam.setEndTime(countParam.getEndTime() - BurialPointConstant.ONE_DAY_TIME_MILLISECONDS * 7);
        int twoWeekBeforeActivePhoneNum = phoneInfoAnalysisService.countActivePhoneNumByDay(countParam);
        int twoWeekBeforeUseTime = userInfoAnalysisService.countUseTimeByDay(countParam);

        //过去一月活跃用户数
        countParam.setStartTime(countParam.getStartTime() - BurialPointConstant.ONE_DAY_TIME_MILLISECONDS * 16);
        countParam.setEndTime(countParam.getEndTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS * 7);
        int oneMonthBeforeActivePhoneNum = phoneInfoAnalysisService.countActivePhoneNumByDay(countParam);

        //过去一月的之前一月的活跃用户数
        countParam.setStartTime(countParam.getStartTime() - BurialPointConstant.ONE_DAY_TIME_MILLISECONDS * 30);
        countParam.setEndTime(countParam.getEndTime() - BurialPointConstant.ONE_DAY_TIME_MILLISECONDS * 30);
        int twoMonthBeforeActivePhoneNum = phoneInfoAnalysisService.countActivePhoneNumByDay(countParam);

        //将过去一周/过去一周的前一周的活跃用户数、使用时长，过去一月/过去一月的之前一月的活跃用户数的数据拼装在list中
        List<Integer> oneList = new ArrayList<>();
        oneList.add(0,oneWeekBeforeActivePhoneNum);
        oneList.add(1,oneMonthBeforeActivePhoneNum);
        oneList.add(2,oneWeekBeforeUseTime);
        List<Integer> twoList = new ArrayList<>();
        twoList.add(0,twoWeekBeforeActivePhoneNum);
        twoList.add(1,twoMonthBeforeActivePhoneNum);
        twoList.add(2,twoWeekBeforeUseTime);
        List<List> countList = new ArrayList<>();
        countList.add(0,oneList);
        countList.add(1,twoList);
        //累积手机数、帐号数、设备数
        countParam.setStartTime((long) 0);
        countParam.setEndTime(countParam.getEndTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS - 1);
        int addPhoneNum = phoneInfoAnalysisService.countAddPhoneNum(countParam);
        int addUserNum = userInfoAnalysisService.countAddUserNum(countParam);
        int addEquipment = equipmentInfoAnalysisService.countEquipmentNum(countParam);
        //将累积手机数、帐号数、设备数拼装在list中
        List<Integer> addList = new ArrayList<>();
        addList.add(0,addPhoneNum);
        addList.add(1,addUserNum);
        addList.add(2,addEquipment);
        List<List> keyIndicatorList = new ArrayList<>();
        keyIndicatorList.add(0,addList);
        keyIndicatorList.add(1,countList);
        return keyIndicatorList;
    }

    /**
     *
     * @param param String companyId;       公司编号
     *              String place;           渠道
     *              String projectId;       项目编号
     *              String firmwareId;      设备固件编号
     *              String firmwareVersion; 设备固件版本号
     *              String appVersion;      app版本号
     *              Long startTime;         查询的开始时间
     *              Long endTime;           查询的结束时间
     *
     * @return historyTrendAnalysisList                    历史趋势中关键指标的所有信息和数据
     *         其中里面分别为： 1.overallTrendList           整体趋势部分所有的信息和数据
     *                       2.detailDataList             详细数据部分所有的信息和数据
     */
    @Override
    public List<List> historyTrendAnalysisList(CountParam param) {
        if (param == null) {
            return Collections.emptyList();
        }
        CountParam countParam = paramDoService.getParam(param);

        //获得按天统计新增手机数
        List<List> addPhoneList = ObjectTransitionArrayListUtils.objectTransitionArrayList(this.addPhoneList(countParam));

        //获得按天统计新增用户数
        List<List> addUserList = ObjectTransitionArrayListUtils.objectTransitionArrayList(this.addUserList(countParam));

        //获得按天统计新增设备数
        List<List> addEquipmentList = ObjectTransitionArrayListUtils.objectTransitionArrayList(this.addEquipmentList(countParam));

        //获得按天统计活跃手机数
        List<List> activePhoneList = ObjectTransitionArrayListUtils.objectTransitionArrayList(this.countActivePhoneNumList(countParam));

        //获得按天统计活跃用户数
        List<List> activeUserList = ObjectTransitionArrayListUtils.objectTransitionArrayList(this.countActiveUserNumList(countParam));

        //获得按天统计活跃设备数
        List<List> activeEquipmentList = ObjectTransitionArrayListUtils.objectTransitionArrayList(this.countActiveEquipmentNumList(countParam));

        //获得按天统计启动次数
        List<List> countStartUpNumList = ObjectTransitionArrayListUtils.objectTransitionArrayList(this.countStartUpNumList(countParam));

        //获得 按天统计累积手机数
        List<List> accumulationPhoneList = ObjectTransitionArrayListUtils.objectTransitionArrayList(this.accumulationPhoneList(countParam));

        //获得按天统计累积用户数
        List<List> accumulationUserList = ObjectTransitionArrayListUtils.objectTransitionArrayList(this.accumulationUserList(countParam));

        //获得按天统计累积设备数
        List<List> accumulationEquipmentList = ObjectTransitionArrayListUtils.objectTransitionArrayList(this.accumulationEquipmentList(countParam));

        //将上面的list拼装到overallTrendList
        List<List> overallTrendList = new ArrayList<>();
        overallTrendList.add(0,addPhoneList);
        overallTrendList.add(1,addUserList);
        overallTrendList.add(2,addEquipmentList);
        overallTrendList.add(3,activePhoneList);
        overallTrendList.add(4,activeUserList);
        overallTrendList.add(5,activeEquipmentList);
        overallTrendList.add(6,countStartUpNumList);
        overallTrendList.add(7,accumulationPhoneList);
        overallTrendList.add(8,accumulationUserList);
        overallTrendList.add(9,accumulationEquipmentList);
        List<List> detailDataList = this.detailDataList(countParam);
        List<List> historyTrendAnalysisList = new ArrayList<>();
        historyTrendAnalysisList.add(0,overallTrendList);
        historyTrendAnalysisList.add(1,detailDataList);
        return historyTrendAnalysisList;
    }

    /**
     *
     * @param param String companyId;       公司编号
     *              String place;           渠道
     *              String projectId;       项目编号
     *              String firmwareId;      设备固件编号
     *              String firmwareVersion; 设备固件版本号
     *              String appVersion;      app版本号
     *              Long startTime;         查询的开始时间
     *              Long endTime;           查询的结束时间
     *
     * @return addPhoneList                  按天统计新增手机数
     */
    private List<DateAndNumBo> addPhoneList(CountParam param) {
        if (param == null) {
            return Collections.emptyList();
        }
        CountParam countParam = paramDoService.getParam(param);
        List<DateAndNumBo> addPhoneList = new ArrayList<>();
        long time = countParam.getEndTime();
        while (countParam.getStartTime() <= time) {
            countParam.setEndTime(countParam.getStartTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS - 1);
            DateAndNumBo dateAndNumBo = new DateAndNumBo();
            int addPhoneNum = phoneInfoAnalysisService.countAddPhoneNum(countParam);
            dateAndNumBo.setTimePoint(countParam.getStartTime());
            dateAndNumBo.setNum(addPhoneNum);
            addPhoneList.add(dateAndNumBo);
            countParam.setStartTime(countParam.getStartTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS);
        }
        return addPhoneList;
    }

    /**
     *
     * @param param String companyId;       公司编号
     *              String place;           渠道
     *              String projectId;       项目编号
     *              String firmwareId;      设备固件编号
     *              String firmwareVersion; 设备固件版本号
     *              String appVersion;      app版本号
     *              Long startTime;         查询的开始时间
     *              Long endTime;           查询的结束时间
     *
     * @return addPhoneList                  按天统计新增用户数
     */
    private List<DateAndNumBo> addUserList(CountParam param) {
        if (param == null) {
            return Collections.emptyList();
        }
        CountParam countParam = paramDoService.getParam(param);
        List<DateAndNumBo> addUserList = new ArrayList<>();
        long time = countParam.getEndTime();
        while (countParam.getStartTime() <= time) {
            countParam.setEndTime(countParam.getStartTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS - 1);
            DateAndNumBo dateAndNumBo = new DateAndNumBo();
            int addPhoneNum = userInfoAnalysisService.countAddUserNum(countParam);
            dateAndNumBo.setTimePoint(countParam.getStartTime());
            dateAndNumBo.setNum(addPhoneNum);
            addUserList.add(dateAndNumBo);
            countParam.setStartTime(countParam.getStartTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS);
        }
        return addUserList;
    }

    /**
     *
     * @param param String companyId;       公司编号
     *              String place;           渠道
     *              String projectId;       项目编号
     *              String firmwareId;      设备固件编号
     *              String firmwareVersion; 设备固件版本号
     *              String appVersion;      app版本号
     *              Long startTime;         查询的开始时间
     *              Long endTime;           查询的结束时间
     *
     * @return addPhoneList                  按天统计新增设备数
     */
    private List<DateAndNumBo> addEquipmentList(CountParam param) {
        if (param == null) {
            return Collections.emptyList();
        }
        CountParam countParam = paramDoService.getParam(param);
        List<DateAndNumBo> addEquipmentList = new ArrayList<>();
        long time = countParam.getEndTime();
        while (countParam.getStartTime() <= time) {
            countParam.setEndTime(countParam.getStartTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS - 1);
            DateAndNumBo dateAndNumBo = new DateAndNumBo();
            int addPhoneNum = equipmentInfoAnalysisService.countEquipmentNum(countParam);
            dateAndNumBo.setTimePoint(countParam.getStartTime());
            dateAndNumBo.setNum(addPhoneNum);
            addEquipmentList.add(dateAndNumBo);
            countParam.setStartTime(countParam.getStartTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS);
        }
        return addEquipmentList;
    }

    /**
     *
     * @param param String companyId;       公司编号
     *              String place;           渠道
     *              String projectId;       项目编号
     *              String firmwareId;      设备固件编号
     *              String firmwareVersion; 设备固件版本号
     *              String appVersion;      app版本号
     *              Long startTime;         查询的开始时间
     *              Long endTime;           查询的结束时间
     *
     * @return addPhoneList                  按天统计活跃手机数
     */
    private List<DateAndNumBo> countActivePhoneNumList(CountParam param) {
        if (param == null) {
            return Collections.emptyList();
        }
        CountParam countParam = paramDoService.getParam(param);
        List<DateAndNumBo> countActivePhoneNumList = new ArrayList<>();
        long time = countParam.getEndTime();
        while (countParam.getStartTime() <= time) {
            countParam.setEndTime(countParam.getStartTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS - 1);
            DateAndNumBo dateAndNumBo = new DateAndNumBo();
            int countActivePhoneNum = phoneInfoAnalysisService.countActivePhoneNumByDay(countParam);
            dateAndNumBo.setTimePoint(countParam.getStartTime());
            dateAndNumBo.setNum(countActivePhoneNum);
            countActivePhoneNumList.add(dateAndNumBo);
            countParam.setStartTime(countParam.getStartTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS);
        }
        return countActivePhoneNumList;
    }

    /**
     *
     * @param param String companyId;       公司编号
     *              String place;           渠道
     *              String projectId;       项目编号
     *              String firmwareId;      设备固件编号
     *              String firmwareVersion; 设备固件版本号
     *              String appVersion;      app版本号
     *              Long startTime;         查询的开始时间
     *              Long endTime;           查询的结束时间
     *
     * @return addPhoneList                  按天统计活跃用户数
     */
    private List<DateAndNumBo> countActiveUserNumList(CountParam param) {
        if (param == null) {
            return Collections.emptyList();
        }
        CountParam countParam = paramDoService.getParam(param);
        List<DateAndNumBo> countActiveUserNumList = new ArrayList<>();
        long time = countParam.getEndTime();
        while (countParam.getStartTime() <= time) {
            countParam.setEndTime(countParam.getStartTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS - 1);
            DateAndNumBo dateAndNumBo = new DateAndNumBo();
            int countActiveUserNum = userInfoAnalysisService.countActiveUserNumByDay(countParam);
            dateAndNumBo.setTimePoint(countParam.getStartTime());
            dateAndNumBo.setNum(countActiveUserNum);
            countActiveUserNumList.add(dateAndNumBo);
            countParam.setStartTime(countParam.getStartTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS);
        }
        return countActiveUserNumList;
    }

    /**
     *
     * @param param String companyId;       公司编号
     *              String place;           渠道
     *              String projectId;       项目编号
     *              String firmwareId;      设备固件编号
     *              String firmwareVersion; 设备固件版本号
     *              String appVersion;      app版本号
     *              Long startTime;         查询的开始时间
     *              Long endTime;           查询的结束时间
     *
     * @return addPhoneList                  按天统计活跃设备数
     */
    private List<DateAndNumBo> countActiveEquipmentNumList(CountParam param) {
        if (param == null) {
            return Collections.emptyList();
        }
        CountParam countParam = paramDoService.getParam(param);
        List<DateAndNumBo> countActiveEquipmentNumList = new ArrayList<>();
        long time = countParam.getEndTime();
        while (countParam.getStartTime() <= time) {
            countParam.setEndTime(countParam.getStartTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS - 1);
            DateAndNumBo dateAndNumBo = new DateAndNumBo();
            int countActiveEquipmentNum = equipmentInfoAnalysisService.countActiveEquipmentNumByDay(countParam);
            dateAndNumBo.setTimePoint(countParam.getStartTime());
            dateAndNumBo.setNum(countActiveEquipmentNum);
            countActiveEquipmentNumList.add(dateAndNumBo);
            countParam.setStartTime(countParam.getStartTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS);
        }
        return countActiveEquipmentNumList;
    }

    /**
     *
     * @param param String companyId;       公司编号
     *              String place;           渠道
     *              String projectId;       项目编号
     *              String firmwareId;      设备固件编号
     *              String firmwareVersion; 设备固件版本号
     *              String appVersion;      app版本号
     *              Long startTime;         查询的开始时间
     *              Long endTime;           查询的结束时间
     *
     * @return addPhoneList                  按天统计启动次数
     */
    private List<DateAndNumBo> countStartUpNumList(CountParam param) {
        if (param == null) {
            return Collections.emptyList();
        }
        CountParam countParam = paramDoService.getParam(param);
        List<DateAndNumBo> countStartUpNumList = new ArrayList<>();
        long time = countParam.getEndTime();
        while (countParam.getStartTime() <= time) {
            countParam.setEndTime(countParam.getStartTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS - 1);
            DateAndNumBo dateAndNumBo = new DateAndNumBo();
            int countStartUpNum = userInfoAnalysisService.countStartUpNumByDay(countParam);
            dateAndNumBo.setTimePoint(countParam.getStartTime());
            dateAndNumBo.setNum(countStartUpNum);
            countStartUpNumList.add(dateAndNumBo);
            countParam.setStartTime(countParam.getStartTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS);
        }
        return countStartUpNumList;
    }

    /**
     *
     * @param param String companyId;       公司编号
     *              String place;           渠道
     *              String projectId;       项目编号
     *              String firmwareId;      设备固件编号
     *              String firmwareVersion; 设备固件版本号
     *              String appVersion;      app版本号
     *              Long startTime;         查询的开始时间
     *              Long endTime;           查询的结束时间
     *
     * @return addPhoneList                  按天统计累积手机数
     */
    private List<DateAndNumBo> accumulationPhoneList(CountParam param) {
        if (param == null) {
            return Collections.emptyList();
        }
        CountParam countParam = paramDoService.getParam(param);
        List<DateAndNumBo> accumulationPhoneList = new ArrayList<>();
        long time = countParam.getEndTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS;
        countParam.setEndTime(countParam.getStartTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS - 1);
        countParam.setStartTime((long) 0);
        while (countParam.getEndTime() <= time) {
            DateAndNumBo dateAndNumBo = new DateAndNumBo();
            int accumulationPhoneNum = phoneInfoAnalysisService.countAddPhoneNum(countParam);
            dateAndNumBo.setTimePoint(countParam.getEndTime() - BurialPointConstant.ONE_DAY_TIME_MILLISECONDS + 1);
            dateAndNumBo.setNum(accumulationPhoneNum);
            accumulationPhoneList.add(dateAndNumBo);
            countParam.setEndTime(countParam.getEndTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS);
        }
        return accumulationPhoneList;
    }

    /**
     *
     * @param param String companyId;       公司编号
     *              String place;           渠道
     *              String projectId;       项目编号
     *              String firmwareId;      设备固件编号
     *              String firmwareVersion; 设备固件版本号
     *              String appVersion;      app版本号
     *              Long startTime;         查询的开始时间
     *              Long endTime;           查询的结束时间
     *
     * @return addPhoneList                  按天统计累积用户数
     */
    private List<DateAndNumBo> accumulationUserList(CountParam param) {
        if (param == null) {
            return Collections.emptyList();
        }
        CountParam countParam = paramDoService.getParam(param);
        List<DateAndNumBo> accumulationUserList = new ArrayList<>();
        long time = countParam.getEndTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS;
        countParam.setEndTime(countParam.getStartTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS - 1);
        countParam.setStartTime((long) 0);
        while (countParam.getEndTime() <= time) {
            DateAndNumBo dateAndNumBo = new DateAndNumBo();
            int accumulationUserNum = userInfoAnalysisService.countAddUserNum(countParam);
            dateAndNumBo.setTimePoint(countParam.getEndTime() - BurialPointConstant.ONE_DAY_TIME_MILLISECONDS + 1);
            dateAndNumBo.setNum(accumulationUserNum);
            accumulationUserList.add(dateAndNumBo);
            countParam.setEndTime(countParam.getEndTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS);
        }
        return accumulationUserList;
    }

    /**
     *
     * @param param String companyId;       公司编号
     *              String place;           渠道
     *              String projectId;       项目编号
     *              String firmwareId;      设备固件编号
     *              String firmwareVersion; 设备固件版本号
     *              String appVersion;      app版本号
     *              Long startTime;         查询的开始时间
     *              Long endTime;           查询的结束时间
     *
     * @return addPhoneList                  按天统计累积设备数
     */
    private List<DateAndNumBo> accumulationEquipmentList(CountParam param) {
        if (param == null) {
            return Collections.emptyList();
        }
        CountParam countParam = paramDoService.getParam(param);
        List<DateAndNumBo> accumulationEquipmentList = new ArrayList<>();
        long time = countParam.getEndTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS;
        countParam.setEndTime(countParam.getStartTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS - 1);
        countParam.setStartTime((long) 0);
        while (countParam.getEndTime() <= time) {
            DateAndNumBo dateAndNumBo = new DateAndNumBo();
            int accumulationEquipmentNum = equipmentInfoAnalysisService.countEquipmentNum(countParam);
            dateAndNumBo.setTimePoint(countParam.getEndTime() - BurialPointConstant.ONE_DAY_TIME_MILLISECONDS + 1);
            dateAndNumBo.setNum(accumulationEquipmentNum);
            accumulationEquipmentList.add(dateAndNumBo);
            countParam.setEndTime(countParam.getEndTime() + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS);
        }
        return accumulationEquipmentList;
    }


    /**
     *
     * @param param String companyId;       公司编号
     *              String place;           渠道
     *              String projectId;       项目编号
     *              String firmwareId;      设备固件编号
     *              String firmwareVersion; 设备固件版本号
     *              String appVersion;      app版本号
     *              Long startTime;         查询的开始时间
     *              Long endTime;           查询的结束时间
     *
     * @return detailDataList               详细数据部分的所有信息和数据
     */
    private List<List> detailDataList(CountParam param) {
        if (param == null) {
            return Collections.emptyList();
        }
        CountParam countParam = paramDoService.getParam(param);
        //获取拼装detailDataList需要所有数据
        List<DateAndNumBo> addPhoneList = this.addPhoneList(countParam);
        List<DateAndNumBo> addUserList = this.addUserList(countParam);
        List<DateAndNumBo> addEquipmentList = this.addEquipmentList(countParam);
        List<DateAndNumBo> activePhoneList = this.countActivePhoneNumList(countParam);
        List<DateAndNumBo> activeUserList = this.countActiveUserNumList(countParam);
        List<DateAndNumBo> activeEquipmentList = this.countActiveEquipmentNumList(countParam);
        List<DateAndNumBo> countStartUpNumList = this.countStartUpNumList(countParam);
        List<DateAndNumBo> accumulationPhoneList = this.accumulationPhoneList(countParam);
        List<DateAndNumBo> accumulationUserList = this.accumulationUserList(countParam);
        List<DateAndNumBo> accumulationEquipmentList = this.accumulationEquipmentList(countParam);
        List<List> detailDataList = new ArrayList<>();
        long timePoint = countParam.getStartTime();
        //对获取的数据进行循环处理，保证数据和时间节点统一
        for (int i = 0; timePoint <= countParam.getEndTime(); i++) {
            List<Long> summarizeList = new ArrayList<>();
            summarizeList.add(0, timePoint);
            summarizeList.add(1, Long.valueOf(addPhoneList.get(i).getNum()));
            summarizeList.add(2, Long.valueOf(addUserList.get(i).getNum()));
            summarizeList.add(3, Long.valueOf(addEquipmentList.get(i).getNum()));
            summarizeList.add(4, Long.valueOf(activePhoneList.get(i).getNum()));
            summarizeList.add(5, Long.valueOf(activeUserList.get(i).getNum()));
            summarizeList.add(6, Long.valueOf(activeEquipmentList.get(i).getNum()));
            summarizeList.add(7, Long.valueOf(countStartUpNumList.get(i).getNum()));
            summarizeList.add(8, Long.valueOf(accumulationPhoneList.get(i).getNum()));
            summarizeList.add(9, Long.valueOf(accumulationUserList.get(i).getNum()));
            summarizeList.add(10, Long.valueOf(accumulationEquipmentList.get(i).getNum()));
            detailDataList.add(summarizeList);
            timePoint = timePoint + BurialPointConstant.ONE_DAY_TIME_MILLISECONDS;
        }
        return detailDataList;
    }

}
